/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// pegmem.cpp - Memory management functions for use with different
//              compiler/RTOS combinations.
//
// Author: Kenneth G. Maxwell
//
// Copyright (c) 1997-1998 Swell Software 
//              All Rights Reserved.
//
// Unauthorized redistribution of this source code, in whole or part,
// without the express written permission of Swell Software
// is strictly prohibited.
//
// Notes:
//
// Providing thread-safe memory management requires more than just including
// this file for certain compilers. Be sure to read your integration notes
// for other details.
//
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/

#ifndef PEG_MEM_INCLUDED
#define PEG_MEM_INCLUDED


/* types and structures */
/* function/operator prototypes and inline operators */

#if defined(__BORLANDC__)

   typedef int (_cdecl * PNHX)( size_t );

   void far  * fnewx(size_t s);

   void * operator new(size_t s);
   void * operator new[](size_t s);


#elif defined(_MSC_VER)

   typedef int (_cdecl * PNHX)( size_t );
   typedef PNHX   _PNH;

   void far  * fnewx(size_t s);

   inline void * operator new(size_t s) { return fnewx(s); }
   inline void operator delete(void * b) { ffreex(b); }
 
#elif defined(__DCC__)   

   typedef int (_cdecl * PNHX)( size_t );


#elif defined(__HIGHC__) 
   typedef int (_cdecl * PNHX)( size_t );

#endif // _MSC_VER
#endif // __NEWX_H


